var myvant  = {
    install(app,options){
        console.log("install");
        // 全局注册一个组件
        app.component("van-button",{
            props:["type","value"],
            template:`<div>
                    <input type="button" :value="value" :style="s[type]" />
                </div>`,

            data(){
                return {
                    s:{
                        "primary":"background-color:red;",
                        "info":"background-color:green;",
                    }
                }
            }
        }),
        app.component("van-cell",{
            props:["data"],
            template:`<ul>
                        <li v-for="item in data">{{item}}</li>
                    </ul>`,

            data(){
                return {}
            }
        })
        // 全局注册指令
        app.directive('myfocus', {
            mounted: function (el) {   // 当被绑定的元素插入到 DOM 中时……
                // 聚焦元素
                console.log("mounted",el);
                el.focus()
            }
        })    
    }
}